﻿using DreamCMS.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DreamCMS.BLL.Factory.Interface
{
    public interface IUserDAO
    {
        /// <summary>
        /// 添加用户
        /// </summary>
        /// <param name="user">用户信息实体</param>
        /// <returns>返回刚刚添加的用户ID</returns>
        long AddUser(UserInfo user);

        /// <summary>
        /// 更新用户信息
        /// </summary>
        /// <param name="user">用户信息实体</param>
        /// <returns>返回更新影响行数</returns>
        long UpdateUser(UserInfo user);
        /// <summary>
        /// 删除用户
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <returns>返回影响行数</returns>
        long DeleteUser(long userId);
        /// <summary>
        /// 获取所有用户
        /// </summary>
        /// <returns>用户实体的集合</returns>
        List<UserInfo> GetAllUsers();
        /// <summary>
        /// 判断用户名是否存在
        /// </summary>
        /// <param name="userName">用户名</param>
        /// <returns>是否存在</returns>
        bool IsUserExist(string userName);

    }
}
